/*
 *  Document   : rec_register.js
 *  Author     : liufei
 *  Description: 
 */



/**
 * 
 */
var BasePagesLog = function() {
    // Init Lock Form Validation, for more examples you can check out https://github.com/jzaefferer/jquery-validation
    var initValidationLog = function(){
        jQuery('#log-form').validate({
            errorClass: 'help-block text-right animated fadeInDown',
            errorElement: 'div',
            errorPlacement: function(error, e) {
                jQuery(e).parents('.form-group > div').append(error);
            },
            highlight: function(e) {
                jQuery(e).closest('.form-group').removeClass('has-error').addClass('has-error');
                jQuery(e).closest('.help-block').remove();
            },
            success: function(e) {
                jQuery(e).closest('.form-group').removeClass('has-error');
                jQuery(e).closest('.help-block').remove();
            },
            rules: {
                'log-email': {
                    required: true,
                    email: true
                },
                'log-password':{
                	required: true,
                	minlength: 5
                }
            },
            messages: {
            	'log-email': '请输入邮箱...',
                'log-password': {
                    required: '请输入密码...',
                    minlength: '密码长度至少5位...'
                }
            }
        });
    };

    return {
        init: function () {
            // Init Reminder Form Validation
        	initValidationLog();
        }
    };
}();

// Initialize when page loads
jQuery(function(){ BasePagesLog.init(); });